<?php
/* @var $this DataBaseController */

$this->breadcrumbs=array(
	'综合控制台'=>array($this->pre_module_url.'/index/index'),
	'网站配置'=>array($this->pre_module_url.'/setting/webconfig'),
	'数据库备份'=>array($this->pre_module_url.'/dataBase/admin'),
);
?>
<div class="shop_set">
	<?php $form=$this->beginWidget('CActiveForm', array(
			'action'=>array('backup'),
			'enableAjaxValidation'=>true,
			'clientOptions'=>array('validateOnSubmit'=>true)
		)); ?>
		<h3 class="fs_14"><span class="f_r fs_12 fw_n">上次备份时间：<?php echo isset($this->dbinfo['pretime'])?date('Y-m-d H:i:s',$this->dbinfo['pretime']):"暂无备份"?></span>数据库备份</h3>
		<ul class="form_list form_list2">
			<li class="c_f"><span class="tit">备份类型：</span>
				<div class="cont f_l"><label class="mr20"><input class="radio" type="radio" name="type" checked="checked" />备份网站全部数据</label></div>
			</li>
			<li class="c_f"><span class="tit">备注：</span>
				<div class="cont f_l">
					<?php echo CHtml::textField('describe','',array('class'=>'t_ipt w_250','maxlength'=>50)) ?>
				</div>
			</li>
			<li class="c_f"><span class="tit">&nbsp;</span>
				<div class="cont f_l">
					<?php echo CHtml::submitButton(Yii::t('adm','立即备份'),array('class'=>'mem_btn mem_btn20'))?>
				</div>
			</li>
		</ul>
	<?php $this->endWidget(); ?>
	<h3 class="fs_14">数据库恢复</h3>
	<ul class="database_recovery c_f">
		<?php $sqlfile = scandir($this->dataPath);?>
		<?php foreach($sqlfile as $val){
			$dir = $this->dataPath.DIRECTORY_SEPARATOR.$val;
			if(is_dir($dir)){
				$datainfofile = $dir.DIRECTORY_SEPARATOR."datainfo.php";
				if(is_file($datainfofile)) {
					$datainfo = include($datainfofile);
		?>
				<li>
					<div class="img"><img src="/images/database.gif" alt="" /></div>
					<p class="title_pro1 t_c"><?php echo CHtml::encode($datainfo['describe'])?></p>
					<p class="c_999 time"><?php echo date('Y-m-d H:i:s',$datainfo['time'])?></p>
					<p class="operate t_c">
						<?php echo CHtml::link('还原','javascript:',array('class'=>'c_06c mr10','onclick'=>'return art_del_confirm("'.$this->pre_module_url.'/dataBase/refresh/id/'.$val.'","你确定要将数据库覆盖到当前数据库吗？")'))?>
						<?php echo CHtml::link(Yii::t('adm','Delete'),'javascript:',array('class'=>'c_06c mr10','onclick'=>'return art_del_confirm("'.$this->pre_module_url.'/dataBase/delete/id/'.$val.'","你确定要删除这条数据库文件吗？")'))?>
					</p>
				</li>
		
		<?php  }}} ?>
	</ul>    	            
</div>    

